proc killmodes {nick chan host} {
  global botnick home bcast 

  if {![onchan $botnick $chan]} {
    putquick "NOTICE $nick :\0034ERROR - Bot Not On Channel - I am currently not on $chan" 
    return 0
  } elseif {![botisop $chan]} {
    putquick "NOTICE $nick :\0034ERROR - Bot dosen't have op status (+o) on $chan"
    return 0
  } else {
    putlog "!$nick ($host)! killmodes $chan"

    if {$bcast == "1"} {
      putquick "PRIVMSG $home :\002$nick\002 ($host) used the killmodes command on $chan"
    }

    set chanpasswd [getchanmode $chan]
    set getchanpasswd [lindex $chanpasswd 1]

    putquick "MODE $chan -k :$getchanpasswd"
    set getchanpasswd [lindex $chanpasswd 2]

    putquick "MODE $chan -ntmlkpsi *"
    putquick "MODE $chan -k :$getchanpasswd"
 
    putquick "NOTICE $nick :\0033Sucessfully killed all set channel modes for \0034$chan"
  }
}









